
import java.util.Scanner;
public class Test2 {

	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		while(s.hasNextLine()){
			int num=s.nextInt();
			if(num<=2000&&num>=1000){
				System.out.println(Integer.toBinaryString(num) + ',' + Integer.toOctalString(num) + ',' + Integer.toHexString(num));
			}
			
			else {
				int sum=0;
				int i;
				if(num<0) num=Math.abs(num);
			  String str1=Integer.toString(num),str2;
			  for(i=0;i<str1.length();i++){
				str2 = str1.substring(i, i+1);
				System.out.print(str2 + " ");
					sum += Integer.parseInt(str2);
				}
				System.out.println(sum);
			  }
				  
			  }
			s.close();
				
				
		}

	}

